import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      component: () => import('@/layouts/MainLayout.vue'),
      children: [
        { path: '', name: 'home', component: () => import('@/views/Home.vue') },
        { path: '/library', name: 'library', component: () => import('@/views/MusicLibrary.vue') },
        { path: '/forum', name: 'forum', component: () => import('@/views/ForumHome.vue') },
        {
          path: '/profile',
          component: () => import('@/views/UserProfile.vue'),
          children: [
            { path: '', name: 'profile', component: () => import('@/views/profile/Index.vue') },
            { path: 'settings', name: 'profile-settings', component: () => import('@/views/profile/Settings.vue') },
            { path: 'messages', name: 'profile-messages', component: () => import('@/views/profile/Messages.vue') }
          ]
        }
      ]
    }
  ]
})

export default router
